import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Play from '../views/play.vue'
import loginRegistered from '../views/loginRegistered.vue'
import Search from '../views/search.vue'
import Menu1 from '../views/Home/menu1.vue'
import Menu2 from '../views/Home/menu2.vue'
import Menu3 from '../views/Home/menu3.vue'
import Personality from '../views/Home/menu1/personality.vue'
import Playlist from '../views/Home/menu1/playlist.vue'
import Mylove from '../views/Home/menu2/mylove.vue'
import Dunamic from '../views/Home/menu3/dunamic.vue'
import Friends from '../views/Home/menu3/friends.vue'
import Near from '../views/Home/menu3/near.vue'
import Login from '../views/loginRegistered/login.vue'
import Registered from '../views/loginRegistered/registered.vue'
import logreg from '../views/loginRegistered/logreg.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home,
    children: [
      {
        path: 'menu1',
        name: 'menu1',
        component: Menu1,
        children: [
          {
            path: 'personality',
            name: 'personality',
            component: Personality
          },
          {
            path: 'playlist',
            name: 'playlist',
            component: Playlist
          }
        ]
      },
      {
        path: 'menu2',
        name: 'menu2',
        component: Menu2,
        children: [
          {
            path: 'mylove',
            name: 'mylove',
            component: Mylove
          }
        ]
      },
      {
        path: 'menu3',
        name: 'menu3',
        component: Menu3,
        children: [
          {
            path: 'dunamic',
            name: 'dunamic',
            component: Dunamic
          },
          {
            path: 'friens',
            name: 'friens',
            component: Friends
          },
          {
            path: 'near',
            name: 'near',
            component: Near
          }
        ]
      }
    ]
  },
  {
    path: '/play/:id',
    name: 'play',
    component: Play
  },
  {
    path: '/search',
    name: 'search',
    component: Search
  },
  {
    path: '/loginRegistered',
    name: 'loginRegistered',
    component: loginRegistered,
    children: [
      {
        path: 'login',
        name: 'login',
        component: Login
      },
      {
        path: 'registered',
        name: 'registered',
        component: Registered
      },
      {
        path: 'logreg',
        name: 'logreg',
        component: logreg
      },
      {
        path: '',
        component: logreg
      }
    ]
  },
  {
    path: '/home',
    name: 'home',
    component: Home
  }
]

const router = new VueRouter({
  routes
})

export default router
